import { lazy } from "react";
import { createBrowserRouter } from "react-router-dom";
import {
  DashboardOutlined,
  ShopOutlined,
  SettingOutlined,
  UserOutlined,
  FileSearchOutlined
} from '@ant-design/icons';
const Layout = lazy(()=> import('../views/Layout'))
const Login = lazy(()=> import('../views/Login'))
const NotFound = lazy(()=> import('../views/NoFound'))
const Deashboard = lazy(()=> import('../views/deashboard'))
const Production = lazy(()=> import('../views/production'))
const ProductionDetails = lazy(()=> import('../views/production/listDetail'))
const Setting = lazy(()=> import('../views/setting'))
const UserInfo = lazy(()=> import('../views/user'))

export const routes = [
    {
        path:'/',
        element: <Layout/>,
        children:[
            {
                index:true,
                element:<Deashboard/>
            },
            {
                path:'deashboard',
                icon:<DashboardOutlined/>,
                label:'概览',
                element:<Deashboard/>
            },
            {
                path:'production',
                icon:<ShopOutlined/>,
                label:'产品群',
                element:<Production/>
            },
             {
                path:'productionDetail',
                icon:<FileSearchOutlined/>,
                label:'产品详情信息',
                element:<ProductionDetails/>
            },
             {
                path:'setting',
                icon:<SettingOutlined/>,
                label:'量化设置',
                element:<Setting/>
            },
            {
                path:'userInfo',
                icon:<UserOutlined/>,
                label:'用户信息',
                element:<UserInfo/>
            }
        ]
    },
    {
        path:'*',
        element:<NotFound/>
    },
    {
        path:'/login',
        element:<Login/>
    }
]
 
export const routers =createBrowserRouter(routes)

